package cn.gift.client;

import cn.gift.domain.LoginUser;
import cn.gift.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @description: AuthClientFallbackFactory
 * @date: 2023/4/25 11:43
 * @author: ZhaoLc
 * @version: 1.0
 */
@Component
@Slf4j
public class AuthClientFallbackFactory implements FallbackFactory<AuthClient> {
    @Override
    public AuthClient create(Throwable throwable) {

        return new AuthClient() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                log.error("熔断降级了！！");
                return null;
            }

            @Override
            public AjaxResult getLoginUser(LoginUser loginUser) {
                log.error("熔断降级了！！");
                return null;
            }
        };
    }
}
